package patrol.mobile.com.mobilepatrol.activity.security.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyEnsureMade2Activity;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencySaveAgency2Activity;
import patrol.mobile.com.mobilepatrol.bean.SaveAgency1Bean;

/**
 * Created by K on 2018/9/11.
 * des:
 */
public class EmergencySaveAgencyListAdapter extends BaseQuickAdapter<SaveAgency1Bean> {
    public EmergencySaveAgencyListAdapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_emergency_save_gency_list;
    }

    @Override
    protected void convert(BaseViewHolder holder, final SaveAgency1Bean item) {
        holder.setText(R.id.tv_num,(holder.getLayoutPosition()+1) +"");
        holder.setText(R.id.tv_produceName, item.getProduceName());
        holder.setText(R.id.tv_produceDate, item.getProduceDate());

        holder.setOnClickListener(R.id.rl_root, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, EmergencySaveAgency2Activity.class);
                intent.putExtra("id", item.getId());
                mContext.startActivity(intent);
            }
        });

    }
}
